This is the readme file for the port to OS/2 1.x--2.x and DOS of Ian Darwin's file(1) command. The UNIX program attempts to determine the type of file based on the contents. A database of signatures (the magic(4) file) is used. Excerpted from the man-page: File tests each argument in an attempt to classify it. There are three sets of tests, performed in this order: filesystem tests, magic number tests, and language tests. The first test that succeeds causes the file type to be printed. Example: [c:\tmp]file * bin: directory file.1: troff or preprocessor input text file39a.zip: Zip archive (at least v2.0 to extract) textfile: English text pencils.gif: GIF picture version 87a 800 x 800, interlaced, 256 colors tarfile: tar archive tarfile.Z: block compressed data - 16 bits Darwin's version has several enhancements over the usual UNIX versions, including: 1. More flexible magicfile entries. 2. An "ascii magic" routine for keywords which can appear anywhere in the file. 3. "-z" option will recursively unwind compress'd files to determine the types. This OS/2 port has an additional enhancement: 4. DosQ[uery]AppType is used to determine the type (DOS, OS/2, 32-bit, etc.) of an executable or DLL. QUICK START: This archive contains only the DOS executable; see src/Where to find locations for OS/2 executables and sources. Copy the file "magic" to one of the following locations: * /etc/ * directory of the exectable * a directory in PATH or DPATH or use the command-line option "-m" to specify the magicfile location. Now try: file * or file *.* Notes: 1. file v3 patchlevel9 is by Ian Darwin (darwin@cs.toronto.edu); see the README file. This is the second release of the OS/2 version. Many thanks to Greg Roelofs (newt@uchicago.edu) for the help. 2. The magicfile needs more work. There are some other suggestions in notes*.os2. Thanks to Jouni Miettunen (jon@stekt.oulu.fi) for the contributions. Darwin collects magicfile entries. 3. See the files notes*.os2 for additional information on the OS/2 and DOS ports. This is the first port to OS/2 and DOS; feedback and magic-file entries are welcomed. 4. The *.man files are formatted by "groff -man"; as such, they are intended to be read with the "less" pager. This pager is available at oak.oakland.edu:/pub/msdos/txtutl/less177e.zip -- Darrel Hankerson hankedr@mail.auburn.edu or hank@ducvax.auburn.edu 11-Apr-93, updated 30-Jul-93 OS/2 version 3.9 to 3.9a updates: Fixes: correct display of date info (e.g., on gzip'd files); fix message on OS/2 exe's with no application type; correct code which could cause trouble with the "-c" option on bad input. Additions and corrections to the magic-file. Changes: In OS/2 versions, continue on to the magic-file checks in the case that DosQueryApptype indicates a DOS executable. This permits use of the checks for special (e.g., compressed) executables.